﻿using System;
using Microsoft.Xna.Framework;

namespace GameName1
{
    class RocketLauncher : Weapon
    {      
        public RocketLauncher(int direction) : base(direction)
        {
            WeaponState = new WeaponStateReady();
        }

        public override void Fire<T>(Vector2 spawnPoint)
        {
            object[] parameters =
            {
                new Vector2(spawnPoint.X, spawnPoint.Y),
                _shootingDirection
            };
            Projectile projectile = (T)Activator.CreateInstance(typeof(T), parameters);
            WeaponState.Fire(this, projectile);
        }
    }
}
